{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import scipy as sp\n",
    "import scipy.linalg\n",
    "import sympy as sy\n",
    "sy.init_printing() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.set_printoptions(precision=3)\n",
    "np.set_printoptions(suppress=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def round_expr(expr, num_digits):\n",
    "    return expr.xreplace({n : round(n, num_digits) for n in expr.atoms(sy.Number)})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <font face=\"gotham\" color=\"purple\"> Calculation of Determinant"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For $2\\times 2$ matrix $\\pmb A$, the algorithm of determinant is\n",
    "$$\n",
    "\\pmb A=\\left[\\begin{matrix} a & b\\cr c & d \\end{matrix}\\right] \\qquad\\text{then}\\qquad \\text{det}\\pmb A=ad-bc\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "a, b, c, d, e, f, g, h, i = sy.symbols('a, b, c, d, e, f, g, h, i', real = True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With defined symbols, the algorithms of $2\\times 2$ and $3\\times 3$ determinants are"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAEEAAAAOCAYAAABw+XH8AAAACXBIWXMAAA7EAAAOxAGVKw4bAAACLUlEQVRIDcWWi1HCQBCGE4YCcOwAO5CxA+gALAE7wBIc7ACsQLQDoAKFDqADlQ7i/4XbzCU8DJDEndm5vbv/bp/3CKIoCorgIAhuxQvxj3hUxJ559pCuhnjq9K7yrMli6lpcCGnjpTZqhWEYqcWoSkh6N1LUkV4S8HmO0to5iw6tkSFtNzc7hClxnEo8K/iFBkFGdMRrl50S/U1vfWnwiw4ClfAfVXBR8EMuCSNFtCn5Ucw5+xK/i7vCPKtN0R4sznMue8KzrjKSLehdiz+c0hu10312CDvUHL5B1+LX5GVQhyxyszcJDCzijCE0bMyN58b668qQsc3ZSCBiO70x3xcSvBKTVPNvpP7UOmxEAPoGoBUBSj076h/DLvz1VciypyvelyjGBmaDZAIwtD6tCJ8HdSQRJYJzEzoekfFsaZ+C9bYKApUiOuZi2rzE8eL5PUTcB0thNgZweuhS7uglmVTCE30jrbmKZS8inCH/eGAo4WpnxoleLqy/rixZtnAMUp8zbBZje1z6ands9u2puajhcDba9xojKMltfwqWtRWR/VR9dT3XmR2xOcH7T6TdrDbJRnFgtFFXTDkZnYK1NWW2vAwxOadJ4IMSuIHdFHfCDgnfrjkQziZOaqLv+vYNvRPOPkG5sDvayhvgzkpsl/wmnsjesacSueX1Y1F+cr99x/8EF70XDZDh7du5/SsAYmymTa0qODq5sMKVTs527CTTf/0PsMf+CMhjiuAXYjIGwmXdKHcAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$\\displaystyle a d - b c$"
      ],
      "text/plain": [
       "a⋅d - b⋅c"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = sy.Matrix([[a, b], [c, d]])\n",
    "A.det()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATUAAAASCAYAAAA6wUk+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAHv0lEQVR4Ae2bj3H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zmQg6rhUTQFLDj9WHXxXSoHU/s7KlouPlY90rfZZf/ujsQku1TY5nVkVONvvWl0pj7bBt2KX6vEZdFXyyW3TNH+jzYzPAtL0+7Refol2DsZQ8viTnxXcmR9dXqixx/cRx6rBjkWZawKb7/iEu2N8NohG2pnmjBv8g/ThHez1fkoPsFrUvIw2tNoYeWrjSit+IajR4ZZuPaBJwY7zQBPK7qK2rhnhgTEve99hh2InORYBFu7SF9oqNea0s0qhX4gpx2/vF7K90VQmpBJHNYgj10kobf+swwPsNsKOYx2d5X30wU68h+CsxM4sEHUqcGRnMRtDk9o5RrH/i2wtftudmhCXs1ipuahkd3ahFfvOHYfqt7RAD/TBTrwsXBxdfudop2eC24XSiZ57H48lt6UZPVCL3zaoCRQ5iw8jTHDuVPjdWeOXGLVvaUEe6IOdeAloLFz87AWswZz7p66PQmLb0qY9UIvff6LYWjUbQZYKAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$\\displaystyle a e i - a f h - b d i + b f g + c d h - c e g$"
      ],
      "text/plain": [
       "a⋅e⋅i - a⋅f⋅h - b⋅d⋅i + b⋅f⋅g + c⋅d⋅h - c⋅e⋅g"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B = sy.Matrix([[a, b, c], [d, e, f], [g, h, i]])\n",
    "B.det()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <font face=\"gotham\" color=\"purple\"> Cofactor Expansion"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " The $(i,j)$-<font face=\"gotham\" color=\"red\">cofactor</font> of $\\pmb A$ is denoted as $C_{ij}$ given by\n",
    " $$C_{i j}=(-1)^{i+j} \\operatorname{det} A_{i j} = (-1)^{i+j} M_{ij}$$\n",
    " where $M_{ij}$ is the <font face=\"gotham\" color=\"red\">minor determinant</font> which excludes $i$th row and $j$th column."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Consider a matrix $\\pmb A$\n",
    "$$A=\\left[\\begin{array}{rrr}\n",
    "1 & 5 & 0 \\\\\n",
    "2 & 4 & -1 \\\\\n",
    "0 & -2 & 0\n",
    "\\end{array}\\right]$$\n",
    "The cofactor expansion looks like this\n",
    "$$\\begin{aligned}\n",
    "\\operatorname{det} A &=1 \\cdot \\operatorname{det}\\left[\\begin{array}{rr}\n",
    "4 & -1 \\\\\n",
    "-2 & 0\n",
    "\\end{array}\\right]-5 \\cdot \\operatorname{det}\\left[\\begin{array}{cc}\n",
    "2 & -1 \\\\\n",
    "0 & 0\n",
    "\\end{array}\\right]+0 \\cdot \\operatorname{det}\\left[\\begin{array}{rr}\n",
    "2 & 4 \\\\\n",
    "0 & -2\n",
    "\\end{array}\\right] \\\\\n",
    "&=1(0-2)-5(0-0)+0(-4-0)=-2\n",
    "\\end{aligned}$$\n",
    "\n",
    "The scalers in front of each smaller determinant is the first row of $\\pmb A$ and the smaller determinants are the cofactors of $\\pmb A$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In general, the expansions across $i$th row or $j$th column are\n",
    "$$\n",
    "\\operatorname{det} A=a_{i 1} C_{i 1}+a_{i 2} C_{i 2}+\\cdots+a_{i n} C_{i n}\n",
    "$$\n",
    "$$\n",
    "\\operatorname{det} A=a_{1 j} C_{1 j}+a_{2 j} C_{2 j}+\\cdots+a_{n j} C_{n j}\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### <font face=\"gotham\" color=\"purple\"> A SymPy Example"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Consider the matrix below and perform a cofactor expansion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAHgAAABLCAYAAAC7ikPRAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKw0lEQVR4Ae2d7XHVOBSG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r0e4zNktTI9ns5r540eBIZZXZ+HHAVP0WIViDsy0fdDSfW4tSnC3NqWXYyvr8i4tDlq5uEhMd83EAgWW7FbbR79ZLtAZneek4moNQCp5VeS2t/J9hN8q+IA42g6mfJUhXGBUPXfgKhM9szQA3jr+tfreawRocSxx0NN+Ifp4Krls8Ro0DDuSz/uK7IxRSsz4OKKHfyTNYgzMrUF6vo7nqFw1SKr7azxR5DNhsYHTMTMKB/O4C4Dp3GGATDjD5jwNUVkS/kwkWGMgFRHP9VRqGZncYFix8zGxdxS++O4PL+TigiH6r4/vClreL4TX7mXTV8X0Xyl1bn1ttstZ2MhVPVwOV4K5OfqmSSvAvRWf3ZCrBXZ38UiXhbdIX7b7ik+OGfNNrwVi25hfQgDhrXI82DQ3BPE40B7BYbg2PGmNMNd/WgDkTtktd7j+kUBsqm2SwugAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}49 & 0 & 61\\\\73 & 22 & 96\\\\2 & 0 & 32\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡49  0   61⎤\n",
       "⎢          ⎥\n",
       "⎢73  22  96⎥\n",
       "⎢          ⎥\n",
       "⎣2   0   32⎦"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = sy.Matrix([[49, 0, 61], [73, 22, 96], [2, 0, 32]]);A"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Cofactor exapansion with the column which has two zero(s): \n",
    "\n",
    "$$\\operatorname{det} A = a_{12}(-1)^{1+2}C_{12}+a_{22}(-1)^{2+2}C_{22}+a_{32}(-1)^{3+2}C_{32}$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use SymPy function for calculationg minors: ```sy.matrices.MatrixDeterminant.minor(A, i, 1)```. We can define a function for cofactor row expansion:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "def cof_exp(matrix, c): # c is the col that we want to expand\n",
    "    detA = 0\n",
    "    for i in range(matrix.shape[1]): # matrix.shape[1] is the number of columns\n",
    "        detA += matrix[i, c]*(-1)**(i+c)*sy.matrices.MatrixDeterminant.minor(matrix, i, c)\n",
    "    return detA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAADMAAAAOCAYAAACCRSRZAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACgElEQVRIDaWWjVXbQAyAbR4DpO0GZYNAJ2hGoCvABuUxAmzQGcIGyQYFNmg2aMIG6fddTu45ttPa6D357vR/kiy73u/3lVDX9WeW23Soqhmr5wf460xrLcjPISzBS2TeWkwO8LVxD/4GP4Gel1PtoRsx3rkHrsAteIfNVwkVGxcd/XAfyPkGlHld0FJAyoIvmT8LfrkqU57dA15+qj2TazLKGB+gaXiR7Gcn3zPx2JGCL6WB2EMPnc5l4JmIm5CNFZrJGG1PfcBE9PnaQd8pc6YUYJneMnr29p6nwgWK36YqD+gtoO9y+5YivgYzX5N0GQJfgx9cQwrmdd7bUmNhhcICG6sj57bFFHv6N7bNiSTPmv5DqNmjZBZ+gZ1WCTl4g22mDGBbuBGV9RJNG4edWLOMsp1WCpm+FXnjhPW3zTinaTEnkzp2qtl6z+AkwLht9piVrYjT5zB1MvG9C7E6UR0MhwnXd1tpgG3mpjeb0P9VGfW9hM5sO22JafIc+4V+0t6xfI7RqjRTs2mtAWEnhQF0Sn/KOTynWeMkO47kaHOUvYHYbNuWjzQALFcuGfwWRJv5Do0BKxIft6RHQE9snHKO57H2ko14EKvJshDxkU+scxhp9nti70R7z0iOL7+Z79iBtsGHl/qYvE94oG+FL8qLQLOVq7PsVMdPPQFcKQQ0I/twHH6GvXDQI2ny/tteqY9NX/gv+GhVHZoX3J5n4WOmGVZAx7c9l8xqg4uTbImNr6UuZ9tjBW0zqDnAQNfsO+7X7MtvlVWeY/Ox5pHUEbCPy6+2yp0fTeTSbwU8q+ZlDcyR+1ODrAmQM4v34PZASc/Oj+YIe/4LarMPXvF9+QccNronb48UUgAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle 31812$"
      ],
      "text/plain": [
       "31812"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cof_exp(A,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or we can try a random matrix with the user-defined function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR4AAACvCAYAAAArKLGyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4Ae2d4bHdtrWFbY1+exRlxv+f0oFsVfDiDmKnAjsd5I0q0MQd2K8CJ+nATgWK1YFTwJuxcscN+K0PF5sBQZAEzyFInHs3ZnhIApvAwgKwCeAQ2B9+8MEHL3X8qKPk/v7rr79+XgpwP2fAGXAG5hj48MMPf1LYi1K4dMqHT5OAr3WNcOr+ld74tTPgDDgDlQz8pSD3mfz+gH+qeL6RJnJFU2DLvZwBZ2AbA9Il3+ZPqBeE10Tx5HJV94rMNNvPeuB3Ov7SowLrCaew0AX9n0jwpzq/5168vYt+o5PkGQ7/TccnkrkbBZ5wc6tcno27thxr5Y4q+la8Ual/1fFClfqDLYeeYW7oD/aMrp/pCGM78+vh3BNOYUHp/C3lRfcob8rg9+ava7hE2XyjA54Jf2bhZ50jli7KXFiquISrs3Ar3apyrJU7utz35E1xfaVDWQjlESaXudqkeGIkP+VEyJ9G9H3uf9Z9bziFB2UyUSDy+zdHiSf5/1nH6YpHGKg43ZS5sFRx2Qtu4agqx1q5Ul3Z029v3mJ8gvjrB090c6nj367S0OCt/H+v7hmavgfXG87fi5R/F/j5Qf7P5M9bvFd3q1z2hrvX8s1xNePtGsVDA2JuInd30YPwH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GMHuFGOo06D6iAvYsqcPxpMIdXKLZZclUE/YhCI0Fh1iQYEDMMmuokTQ32SDWtRFIajS/lGwK1LGTxb/NRglAxdSno8JVc0/FcSvMbvVnCSR2FlkpkyN854uQxGDxVOXXitwyaS+Rv2kPJWOkXXGybh4WVnvR7aA0OviWHGs3ErfXphaY8W3KVFolVyenbkFH/400K6wA36jZjxG2fAGWjGQKp4dh1qNUPsETsDzsCDYsAVz4MqTs+MM3AbDLjiuY1ycpTOwINiwBXPgypOz4wzcBsMuOK5jXJylM7Ag2Ig/YDwJ80655n7u/76Sv9ey8P93hlwBpyBCQPSJexY+WISED1QPHyPM7dWqZslDnMZcH9nwBnokoHSF+0D0P8HJTR5EmL2418AAAAASUVORK5CYII=\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 21 & 0 & 20 & 11 & 0\\\\37 & 36 & 28 & 30 & 35 & 43 & 16\\\\38 & 49 & 0 & 28 & 0 & 33 & 48\\\\19 & 0 & 0 & 44 & 26 & 39 & 31\\\\22 & 43 & 0 & 48 & 0 & 0 & 46\\\\21 & 24 & 45 & 0 & 34 & 36 & 0\\\\16 & 12 & 12 & 40 & 0 & 50 & 33\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡0   0   21  0   20  11  0 ⎤\n",
       "⎢                          ⎥\n",
       "⎢37  36  28  30  35  43  16⎥\n",
       "⎢                          ⎥\n",
       "⎢38  49  0   28  0   33  48⎥\n",
       "⎢                          ⎥\n",
       "⎢19  0   0   44  26  39  31⎥\n",
       "⎢                          ⎥\n",
       "⎢22  43  0   48  0   0   46⎥\n",
       "⎢                          ⎥\n",
       "⎢21  24  45  0   34  36  0 ⎥\n",
       "⎢                          ⎥\n",
       "⎣16  12  12  40  0   50  33⎦"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B = sy.randMatrix(r = 7, min=10, max=50, percent=70);B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGYAAAAPCAYAAAAWJLrwAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEtElEQVRYCe2Y7XFVRwyGMUMBDqkg0AExHZgOYKgA6ACGChjSAekgMR3gFnAH0IHBHZjnWVYb7Z495547yc/szFor6ZVW0n6d65Pb29s7/7f/pgInJycP8HRO/5u63vwbrydrC8Mkj3D8Cv2rcQJ076vsGvqQ/h7c1xEnn7Ch/gvsVTA1mTeVP4N+o7/JmMAG3eHzFOxbuvH9Spe/wOcldLXhdzXn0WiGRfYU3MWITfwNMfyS+PX6ALwz6xh/oZtMp0f2mf405IxNWuyDkEnlq/w85PAG/SXxYro54F10HTS7Ae9cTce481nn/hA2QSuuxR3yTMFMc86YGM+wyIzd+hjTh6Hru83PeLM+XdHTpK8xXASJ7KXywAVFZkCfgpfSDLArkBh74BibwGnwQZF9twcfFNken8b4MmyCInMDfQ5+pOimOY84+TUs8i7fsEXuInQ6+M1cFguDgcfZ5MrKh/MakIXtdniVe4SNuBQZ2vHZRx6DcwGaXeiQuWDK2ylkvNfnYpPUGFcXBt+rOUdMQbewxhi4TJF3NRNHX+Sdbe4CGNtzAH+Owsr7sPkGjO2mCtTbvN+9T0NehJM/3vlfN3AWM9pen26ec+77T/Rs74J5vczaVs4jfhVLHh9HMDE477tBfjCXe9kAJx7nafBDktksj+9Xxh14hY30Of2a7keCO6c9wIyfIZs17TzN7SMBdq/PS+a1QO7K74z9sHBur9BZ4VZzxqZr+NqN1RC8V9gj5o2Pm/B3MJe2MNWJu3z6dYXH+9Xr7BTEKTrFT96lZzkodBbqxaxAETF6gzahlsyxPvH/DBt3qoWUusDSroFxnq2cG/4YbDP6OWc37+5cSKK8Mzjzk7e9OfDdGwNvEt6LHU4bmsUsOqgL4xjVP/4qztPou1LeolFfMX50jA/lUT6x97RYEGP2aivxQNvXXJ2rywV9l3OOD91ubPVd6pV9VPmuXO4yoUfOx356hamvLU5F8JnGabpm8puqmJ08Ezews2wcY+Iwhkt8dL+djvFZc3mCjb+FfL+e4DOuzIvYsTtzLqEdg41coOaQr+Ki2pvLPSZ1Zd3Bs0IWZ/7RIViHFnZsIQsf0ligESvvnF2ryTtPtygJtNenJ+W3ZKfPj/j3nfE0+mFgwQ7mrA+wu+ojdmie2qjHoCryzfr4xjjxYwLwEzW3ctdXuTvPO9+He1FUZHFi4mE3oBkOcWldwMxhEg/zotSCWNTAHvSJjRvEgi+S1g96H39jPSbnY7C4LotpHNotTox62sFcTHzaMfYtGL+/vfJmP/y8gtqPN8Z+NuO6942svDFZjswN0N3f6mk+3O0tYrzLJzjjbr9/hrl8b6a6Ouci52yfx3Werj6hR1dihXZv5agPPqh4/cpPF6Uofj6Y7Vd6Mh7/teDuMCE/C5s/eIvQCs44cO1HGDJ3VXnsoQYV3dM7+w/DHp8WpbxlQzxuqtdZNo7RuyMWOY84+S0sOm8AQS3/0Qe6zVwW/8TkuFscH2d3ss3ryWD/kKnXxVuG1/K0x/R36BfHFqz3vQti8wrpcOgtYMwjJrcrfP6eBY4P+awYfRrjN/naut9QIZTiczPnY7H4c8OZ26GfBqv1+QGd/mozKwInTwAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle 4062684476$"
      ],
      "text/plain": [
       "4062684476"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cof_exp(B,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then verify the result of using determinant method  ```.det()```. We can see indeed cofactor expansion works!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGYAAAAPCAYAAAAWJLrwAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEtElEQVRYCe2Y7XFVRwyGMUMBDqkg0AExHZgOYKgA6ACGChjSAekgMR3gFn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Q7mrA+wu+ojdmie2qjHoCryzfr4xjjxYwLwEzW3ctdXuTvPO9+He1FUZHFi4mE3oBkOcWldwMxhEg/zotSCWNTAHvSJjRvEgi+S1g96H39jPSbnY7C4LotpHNotTox62sFcTHzaMfYtGL+/vfJmP/y8gtqPN8Z+NuO6942svDFZjswN0N3f6mk+3O0tYrzLJzjjbr9/hrl8b6a6Ouci52yfx3Werj6hR1dihXZv5agPPqh4/cpPF6Uofj6Y7Vd6Mh7/teDuMCE/C5s/eIvQCs44cO1HGDJ3VXnsoQYV3dM7+w/DHp8WpbxlQzxuqtdZNo7RuyMWOY84+S0sOm8AQS3/0Qe6zVwW/8TkuFscH2d3ss3ryWD/kKnXxVuG1/K0x/R36BfHFqz3vQti8wrpcOgtYMwjJrcrfP6eBY4P+awYfRrjN/naut9QIZTiczPnY7H4c8OZ26GfBqv1+QGd/mozKwInTwAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle 4062684476$"
      ],
      "text/plain": [
       "4062684476"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B.det()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font face=\"gotham\" color=\"red\">Minor matrices</font> can also be extracted by using code ```sy.matrices.MatrixDeterminant.minor_submatrix()```, for instance, the $M_{23}$ matrix of $\\pmb B$ is"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPQAAACWCAYAAADpE6WvAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAfGklEQVR4Ae2d69HfNNrGk0w+MyHM8P3NdpBNKiB0wKEC2A5gUgEDHcBWwKED2AqypAMoYGcIz9BA3uun6DayLNvyQbb8RJrx39b50qX7lmT9JfnunTt3Huv6VVfK/PT69euPUx7NrTHQGDiegbt37/6mXB+lcpau3r0feHyjZwKH5vfQ0p4bA42B0xn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AqIv3UcLUuTkhgvj7qbQPlGINMUO87FnCK7GqMJ596JVtD/9q8EWAqkBZ9Bg0zDHxtxSjXkcdje7eJn9GMHZuIVx9qMFEJIbbo68vYfcrmWcyPTQCp/AAYEMe6r+aAD4K8PJzHuqUbYeGv8jDSO+VA/s8EiZGb5iTsGtuqOhY3RKPY5+tCA3HOnMmb17aGbvUhXOMb/8nXV0hSfLLwIfy+Op8MSTYCh5SkCS6ZR2rBAncw2p1ybql+Ocp0ZnJehi3iP10T4mn0JZOwW35wNOfkpwYzzah/Jmw+UQuKtCCzQkugPNLXPf+px2oLnhsLvw0OBQwSzgd4fZ+ztuc4fIWzLF7zXiVP3yN8srYaPhc0bP9EJn1a+rPw/F8LAyC9P9PXkybjoNVkp2xvMHb6G85Ybr0kk9ZJ/LLRBOCZQILQtgGD4zpBkcoK+wbj2t/DAMfxYfHu5iLvzJwagwDIHooVOm99GAVIA93K6CM1VWYafuNx8On0p7jZvw0EDbSAtZY4Q1+BjBmbiVNyOGroHRM5hTmzOywiluzyh95oJYbt0O2u8x0yyNgQsyECr0rkPuC3LRIDcGbhUDTaFvVXW2wrztDDSFftsloJX/VjHQFPpWVWcrzNvOQFPot10CWvlvFQPhSrHfNFsWF44/xMPp9ti/2RsDjYEDGZCOuuOexrJEofk/eWwtczVLNccK0NwbA28ZA6zxGDX/Dx1+cbE1Uv/RAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 21 & 20 & 11 & 0\\\\37 & 36 & 28 & 35 & 43 & 16\\\\19 & 0 & 0 & 26 & 39 & 31\\\\22 & 43 & 0 & 0 & 0 & 46\\\\21 & 24 & 45 & 34 & 36 & 0\\\\16 & 12 & 12 & 0 & 50 & 33\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡0   0   21  20  11  0 ⎤\n",
       "⎢                      ⎥\n",
       "⎢37  36  28  35  43  16⎥\n",
       "⎢                      ⎥\n",
       "⎢19  0   0   26  39  31⎥\n",
       "⎢                      ⎥\n",
       "⎢22  43  0   0   0   46⎥\n",
       "⎢                      ⎥\n",
       "⎢21  24  45  34  36  0 ⎥\n",
       "⎢                      ⎥\n",
       "⎣16  12  12  0   50  33⎦"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sy.matrices.MatrixDeterminant.minor_submatrix(B, 2, 3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font face=\"gotham\" color=\"red\">Cofactor matrix</font> is the matrix contain all cofactors of original matrix, and function ```.cofactor_matrix()``` can do the job.\n",
    "\n",
    "$$A=\\left[\\begin{array}{rrr}\n",
    "C_{11} & C_{12} & C_{13} \\\\\n",
    "C_{21} & C_{22} & C_{23} \\\\\n",
    "C_{31} & C_{32} & C_{33}\n",
    "\\end{array}\\right]=\n",
    "\\left[\\begin{array}{rrr}\n",
    "(-1)^{1+1}M_{11} & (-1)^{1+2}M_{12} & (-1)^{1+3}M_{13} \\\\\n",
    "(-1)^{2+1}M_{21} & (-1)^{2+2}M_{22} & (-1)^{2+3}M_{23} \\\\\n",
    "(-1)^{3+1}M_{31} & (-1)^{3+2}M_{32} & (-1)^{3+3}M_{33}\n",
    "\\end{array}\\right]\n",
    "$$\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAANYAAABLCAYAAAAMG3mzAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAOLUlEQVR4Ae2d65HUuBbHZ6b2862BrdrvO2TAQgRABsBGsGwGUBsBxWYARMAjAyACLmQAAdyqC1M3gbn/n9fHyLJsSz3ubrnnqEptPY4e569z9LKsPj46Orop+0k2Zd5eXFw8SEV4mCNwlRE4Pj7+Iv7PUhhIZ45/CiL+lhvi0HwNPe52BByBDoFnneuH456c9/GGivVcmraYIkmj0ea7sq+V7zmFuXEEDgUByfSLmBfJP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GEtxR2LHY38LCXYcs+a4exMsVQxBBymrMcYXEzZgsQ6KlQClGN0e7iltTybF3stACgNZZK+WV/pGZrBVCCMrNidxRMCIGziCznppQeL75y22QceBfVidMq98JV2R2E+pngSbnTC3MDM3xmFo1rRIVy/sDOFroc5AhsgIEWkA2eWcHyyQXpP4gg4AjMIuGLNAOTRjsAmCLhibYKap3EEZhBwxZoByKMdgU0QcMXaBDVP4wjMIBBut3PIMCZ/qx2Og3nnETPnfkdgUwSkKxxvOhtLj2Lxwqt7iRgRZr0Mi9K41xG4CgikTnt0fP8fP8r9Wta4uIoAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}704 & -2144 & -44\\\\0 & 1446 & 0\\\\-1342 & -251 & 1078\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡ 704   -2144  -44 ⎤\n",
       "⎢                  ⎥\n",
       "⎢  0    1446    0  ⎥\n",
       "⎢                  ⎥\n",
       "⎣-1342  -251   1078⎦"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sy.matrices.MatrixDeterminant.cofactor_matrix(A)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <font face=\"gotham\" color=\"purple\"> Triangular Matrix"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If $\\pmb A$ is triangular matrix, we can use cofactor expansion repetitively, the determinant of the matrix will be the product of the elements on the principal diagonal. \n",
    "\n",
    "$$\n",
    "\\operatorname{det}A_{n\\times n} = \\prod_{i=1}^n A_{ii}\n",
    "$$\n",
    "\n",
    "where $A_{ii}$ is the diagonal element."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's generate a random upper triangluar matrix."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[23., 74., 71., 67., 21.],\n",
       "       [ 0., 44., 54., 43., 74.],\n",
       "       [ 0.,  0., 64., 82., 91.],\n",
       "       [ 0.,  0.,  0., 30., 19.],\n",
       "       [ 0.,  0.,  0.,  0., 46.]])"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = np.round(np.random.rand(5,5)*100)\n",
    "A_triu = np.triu(A); A_triu"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKsAAAAPCAYAAACbZT/hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEz0lEQVRoBe2a8VXUQBDGPSoArEBKAEugBCxB6AAfFfiwAyxB7AA6UOxAOxCug/P75XbCZC+5+6LJ4x/3vWGzs9/MN7uZ28yFW6xWq1cv1RaLxZG4TyVfFMfypeL4z/uyO+DmwSKSVQb7CvlK8lvyWsL4VvP36jtN2JukONT1+zrZSgAXBYcvEvM6+xPmTLrbgunrlsIf5AmT21qLE+NY7oyvr53YsXFxY7CuTxc3Jbc4vTxQMrxC1G7iOnrpSKSzNCYJfkouk+5Y4yfJUdKB6/jT+FwCUfZ3rfGDBB4+AFngyViLmxjwE7FEL13fWjo4YTZiLP5s7uDLvfxa9i5uTEyuTxc3E7eVB5Go3KTzvMEpqIfQC8MNf4px9NLdSdobr+tLSZ2Y3DB02V9rE77o1TiFO3Mau9zuWqwYSzwWd15Dvh4Ru80ztU/X35j9cH0K17nXsXfSd/IgkpXMvgtQ9NKRYDm5OsmWcNhr2J7S1KGctqehowcjyf7ak7PCUX40sUVf2yZ9ze2uxYoRHpc7Yqp7197FjYnJ9eniZuK28mBPQdI4GU9VO9xJSNBo3PimPk36x5hMPXUutRYlAUl2LzmgZ0zTHHUJra13Nf91rXr+KxycH581jW3EtJNbdjvXgm83xjHrzjHHtWvv4vDrYqfGzcGNTzcPmmQtSUXiNKeNFnkpIak4bT8Xh0t6Nb5Q1Y0vZLS+OTYXvyThRfgDXDfhOPaPhfmR5zS2uYXlA7J1Ldl3XA/FOIY7fOXetXdx+HaxU+Pm4M57FddDeRAnKxvwTuBPxYDEeivpJI3GJAEJVbfmRJWyMyfSYwm1IW8F8PVdsq3Bi/Q1m9tcS8Nhxmhz9wUunWvv4qBxsVPj5uDGZ279eaAbS6IC5DENiITjUYoSaetOXfM47tSiGpOofDEA21t7JP+DGNnCK2i3Vo2x5mxu4pBsXUv4zX2x24hxDHf2F9euvYvDr4udGjcHd+xT8T2YB817Vp0ufIM+ETjei0aNSRLyCH6jueZRLCxJQyLwaonH/zcJBOjwUZ/GUq+bbEl07KlnG39lCj7s+WCchK7uHW5h7LXU/hkPxehw9/kLnWvv4kqs1r1wfbq4ObjTPg3ngZIDXJNEXGeRvsly9YMnZrGnvsXRfhlz2lJ71v7ixN7wJzzJv/FGovZRj2VTc1trIT6kx99gjD3YDnc9v2tcxz6Ed3HYu9ipcVNxK67BPNgrnyaSrHPSsWrpfqmj5jlkvKVR3/IGYFn88aL/oVxvMVtPFRwfjI0Ydhqva+vMvXMtfxPjQBztugfmd6ldexcHn4udGvfP3DvzoHwiOI3a/0ChC5Gek6aZU38m6ZxczEn4SLenVMH0vSvFtj2BEwdvC9D3vhwuMY7hdtZCLFaMwlncsZ66d+1d3Mj9sGJ/Se7YL8WwNQ/2BKDxJuC2Pgk1pv7j0cwJSyMxH5ur5z88CnkllWvVD9KR5G2TLzaNGgtsfYKip9X6tXb91+V21zImRoub/ZOsJDxZcrPsZeDi8O1ip8bNwY1P2tY8yD9koYa7kuRk3Pghi24EBXA0nG9gmBSOTwmJE41N6/yQJSaEZY4bzA9iKDt62whudy1jYnTXTc1FWdJ+WWUxI2K3eObw6cY4B3fxuTUP/gA9UR6kFd1EqQAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle 89379839.99999997$"
      ],
      "text/plain": [
       "89379839.99999997"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linalg.det(A_triu)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Extract the diagonal by using ```np.diag()```, then calculate the product. It works as well!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGIAAAAPCAYAAAAfzxqKAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEh0lEQVRYCc2Y7XEcNwxAdRkX4I8KonSgsTuwO3AmFdjuQB5X4LE7cDpIlA7kDhK5A6kDRepAeW9NUCCP2uX9cjCDIwmAAAGCIPd2d3d3Rz8KdrvdMbZfgn+yjtsftY7/g91dbARBecyCPoDX4DPQ8Rn8r7QNIPslEZ7Sf9MHsgT5XZFTl0H/lPUh8xraWZEZNbfIP8mMSdvTvnS6Txi/w2asO7OPsP2pEIzRL6D+XDVCK4PV+Sg6EoEv0Y8WmkF6ncY6eAmeJpqLvwGPE025Rh/jt6CGsj4duwC14+Zm1E6WnbLtGtQTa4kWWuNL0HOLjDZNviUmuYXuOkfrqX5n+b6/NT82wSC9HUzW+Yug09eZmxhHC+0crM7TPwX7oKtLWtZX54QuW8DT0/AYz9qe8iXbKzZd83AjoKvzcjDHRDrv6f14Zv5PCAkes1+X3vqPpWR0FL9Bd7EBjm8LLjQW57gHN3AEHvm+PMzanvWl2qVkeKqb9Vbm946x0ace/obwkvkm2Rpszo+NMCAqPO+UuuPLfZDo/w4sWjOtoTrkKfsKPrF1LMAzkEK9X+D/9Z10/4ucNj/eU5a54eimbeZt+pJ1l/5vrOX3AT1IPihGtiO55K/B5vxHzjZgBMCgGKwb+u9pzSyP3RIs2lvokI6e+tOBl7sw4rkJLsQAexE+6DBylqQTZLRf4RDbyG76UhXTwaYlqSZH5tmHH0nQs/J46Pch8+NEuBken89Fu0F7DvbH0U0xWD0sJwFiw8OJk+KoZUZd//QTu7F2xRFM2570xSC7Xl9mo3Iba4ggR/YH3TZOydpmTc2vG8GionR4EiwpBvcSej52b6BFhtu1r1wsMha28HDwG/i5BOYPiBfJziITP9ANiq+SWs6CV9pp28nGmi+qXT2hnf21YVSENZk13rNlI1i4F+0rgvAevAJfMY7L+wz+suPQDfjP8qCdgmavAfTSEh7MLOaa0c6v+pyQIE5NIt13Z23P+lLkHixJ95Zr1idS7Ua2L3dkpbadJjlbVi3l1/F89TvgMc4u42ihGeTmGRq83CKjQ8otOmg9Jdb6Xp8X6VAfdJ+Om0/Bgc7e9qYv2NGv+i0UOqEt3zQxjha6a26e0/IAq8jQn5hb5DbnPyIzzHYDaLY2AO0KvpkcO9/w08D7xJeSF7r6dMiy5ctpT6+8DGWOwfEeORR62zO+aOsFdv02yWACHRe6lSEeDZZL5/QQcXmonIb89nyMKdx8GUsLhGcWL1+PtGZAk3HyQJXUE1Bk9r5QC13Z5vQx9h4aZk1axyG2h1+72Ki+hN7cwte30bot3aMPWU9j/UDNunIfmc35UZoMhFncB0gF9QjbBy0hVY6+zjVf5Y4HNANpsBtZFwwEzw+5mgS5j8ys7Slfsu7oY8PFDMsjdP3u/+Jw43ICWg3Usbc50Fbn5z/9PJYfwHy57P3px7HNz0sN78lAi5dVXPiSPDnNn34SBXTKMxH889BSOIQDbE/5EkbQa2Y/B50nWErckHjOu0Z9NT7XoPAC/IhMU06RM+CW6eafga35/wG/IEI2DtOQWwAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle 89379840.0$"
      ],
      "text/plain": [
       "89379840.0"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A_diag = np.diag(A_triu)\n",
    "np.prod(A_diag)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <font face=\"gotham\" color=\"purple\"> Properties of Determinants"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are many properties of determinants, however they are mostly derived facts from cofactor expansion.\n",
    "<font face=\"gotham\" color=\"red\"> \n",
    "    \n",
    "1. Let $A$ be an $n×n$ square matrix. If one row of $A$ is multiplied by $k$ to produce the matrix $B$, then: $\\text{det} B = k\\, \\text{det} A$.\n",
    "2. Let $A$ be an $n×n$ square matrix. If two rows of $A$ are interchanged to produce a matrix $B$ , then $\\text{det}B=-\\text{det}A$.\n",
    "3. Let $A$ be an $n×n$ square matrix. If a multiple of one row of $A$ is added to another row to produce the matrix $B$, then $\\text{det}A=\\text{det}B$.\n",
    "4. If $A$ is an $n×n$ matrix, then $\\text{det}A^T = \\text{det}A$\n",
    "5. A square matrix $A$ is invertible if and only if $\\text{det}A\\neq 0$\n",
    "6. If $A$ and $B$ are $n×n$ matrices, then $\\text{det}AB = (\\text{det}{A})(\\text{det}{B})$\n",
    "7. If $A$ is an $n×n$ matrix and $k$ is a scalar, then $\\text{det}\\,kA=k^n\\,\\text{det}A$.\n",
    "8. If $A$ is an invertible square matrix, then $\\text{det}A^{-1}=\\frac{1}{\\det A}$.\n",
    "</font>\n",
    "\n",
    "All of them are straightforward, the key is to understand them in terms of cofactor expansion."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font face=\"gotham\" color=\"red\">Proof of property 6</font>:\n",
    "$$\\begin{aligned}\n",
    "|A B| &=\\left|E_{p} \\cdots E_{1} B\\right|=\\left|E_{p}\\right|\\left|E_{p-1} \\cdots E_{1} B\\right|=\\cdots \\\\\n",
    "&=\\left|E_{p}\\right| \\cdots\\left|E_{1}\\right||B|=\\cdots=\\left|E_{p} \\cdots E_{1}\\right||B| \\\\\n",
    "&=|A||B|\n",
    "\\end{aligned}$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font face=\"gotham\" color=\"red\">Proof of property 7</font>:\n",
    "\n",
    "Because $\\text{det} B = k\\, \\text{det} A$, one row of $A$ is multiplied by $k$ to produce $B$.Then multiply all the rows of $A$ by $k$, there will be $n$ $k$'s in front of $\\text{det} A$, which is $k^n \\text{det} A$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font face=\"gotham\" color=\"red\">Proof of property 8</font>:\n",
    "$$\\begin{aligned}\n",
    "&\\begin{aligned}\n",
    "A A^{-1} &=I \\\\\n",
    "\\left|A A^{-1}\\right| &=|I|\n",
    "\\end{aligned}\\\\\n",
    "&|A|\\left|A^{-1}\\right|=1\\\\\n",
    "&\\left|A^{-1}\\right|=\\frac{1}{|A|}\n",
    "\\end{aligned}$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These properties are very useful in analytical derivation of some other theorems, however not useful in numerical sense."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <font face=\"gotham\" color=\"purple\"> Cramer's Rule"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For any $n\\times n$ matrix $A$ and any $b$, denote $A_i(b)$ the matrix obtained from $A$ by replacing column $i$ by the vector $b$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$A_{i}(\\mathbf{b})=\\left[\\begin{array}{lllll}\n",
    "\\mathbf{a}_{1} & \\cdots & \\mathbf{b} & \\cdots & \\mathbf{a}_{n}\n",
    "\\end{array}\\right]$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The <font face=\"gotham\" color=\"red\">Cramer's Rule</font> is \n",
    "$$x_{i}=\\frac{\\operatorname{det} A_{i}(\\mathbf{b})}{\\operatorname{det} A}, \\quad i=1,2, \\ldots, n$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Proof：\n",
    "\n",
    "$$\\begin{aligned}\n",
    "A \\cdot I_{i}(\\mathbf{x}) &=A\\left[\\mathbf{e}_{1} \\quad \\cdots \\quad \\mathbf{x} \\quad \\cdots \\quad \\mathbf{e}_{n}\\right]=\\left[\\begin{array}{llllll}\n",
    "A \\mathbf{e}_{1} & \\cdots & A \\mathbf{x} & \\cdots & A \\mathbf{e}_{n}\n",
    "\\end{array}\\right] \\\\\n",
    "&=\\left[\\begin{array}{llllll}\n",
    "\\mathbf{a}_{1} & \\cdots & \\mathbf{b} & \\cdots & \\mathbf{a}_{n}\n",
    "\\end{array}\\right]=A_{i}(\\mathbf{b})\n",
    "\\end{aligned}$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Use determinant's property,\n",
    "$$(\\operatorname{det} A)\\left(\\operatorname{det} I_{i}(\\mathbf{x})\\right)=\\operatorname{det} A_{i}(\\mathbf{b})$$\n",
    "\n",
    "$\\text{det}I_{i}(\\mathbf{x})$ is $x_i$, by using cofactor expansion.Then we proved the Cramer's Rule."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <font face=\"gotham\" color=\"purple\"> A NumPy Example"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solve system\n",
    "$$\\begin{aligned}\n",
    "&2 x-y+3 z=-3\\\\\n",
    "&3 x+3 y-z=10\\\\\n",
    "&-x-y+z=-4\n",
    "\\end{aligned}$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we have many ways of solving the system, start from Cramer's Rule."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "A = np.array([[2, -1, 3], [3, 3, -1], [-1, -1, 1]])\n",
    "b = np.array([-3, 10, -4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "A_1b = np.copy(A)\n",
    "A_1b[:,0]=b\n",
    "\n",
    "A_2b = np.copy(A)\n",
    "A_2b[:,1]=b\n",
    "\n",
    "A_3b = np.copy(A)\n",
    "A_3b[:,2]=b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAl4AAAAVCAYAAACXIeAAAAAACXBIWXMA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": [
       "$\\displaystyle \\left( 1.0000000000000007, \\  1.9999999999999982, \\  -1.0000000000000002\\right)$"
      ],
      "text/plain": [
       "(1.0000000000000007, 1.9999999999999982, -1.0000000000000002)"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1 = np.linalg.det(A_1b)/np.linalg.det(A)\n",
    "x2 = np.linalg.det(A_2b)/np.linalg.det(A)\n",
    "x3 = np.linalg.det(A_3b)/np.linalg.det(A)\n",
    "(x1, x2, x3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next we try built-in ```np.linalg.solve```."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.,  2., -1.])"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linalg.solve(A, b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or we could use $A^{-1}b$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.,  2., -1.])"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linalg.inv(A)@b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "However, remember that Cramer's rule is rarely carried out in practice when solving system of equation, since computational cost (measured by the number of floating operations, <font face=\"gotham\" color=\"red\"> flops</font>) are much higher than Guassian-Jordon elimination."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <font face=\"gotham\" color=\"purple\"> A Formula For $A^{-1}$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An alternative algorithm for $A^{-1}$ is\n",
    "$$A^{-1}=\\frac{1}{\\operatorname{det} A}\\left[\\begin{array}{cccc}\n",
    "C_{11} & C_{21} & \\cdots & C_{n 1} \\\\\n",
    "C_{12} & C_{22} & \\cdots & C_{n 2} \\\\\n",
    "\\vdots & \\vdots & & \\vdots \\\\\n",
    "C_{1 n} & C_{2 n} & \\cdots & C_{n n}\n",
    "\\end{array}\\right]$$\n",
    "\n",
    "where the matrix of cofactors on RHS is the <font face=\"gotham\" color=\"red\">adjugate</font> or <font face=\"gotham\" color=\"red\">classical adjoint matrix</font>, SymPy function is ```sy.matrices.MatrixDeterminant.adjugate```. And this is the transpose of the cofactor matrix which we computed using ```sy.matrices.MatrixDeterminant.cofactor_matrix()```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <font face=\"gotham\" color=\"purple\"> A SymPy Example"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAAB9CAYAAABZCXQFAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAREElEQVR4Ae2dcZLUNhbGZ6j8nZpA1f6f4QZkOUHIDWBzgg03WIoTbJEbwJ4gwA0gJyBwAzjAVi1M5QLs93P0XBq3p9u2ZEvqfqpy25Zt6dOn96RnWXp9fnZ2dk/be21j4fXXr18fjV3wOGfAGUhj4Pz8/KNSuBxLRXp3/k104Vcdc3McPsUnfuwMOANZGXg2ktpPintIfKycz6WtqymjWol7Sv9DDEZxFzq/vWa+cX5+7AzUxIDk/sUQj3SCqB3lHN6X+/z3oIymoCgm4Ye/dmV/hc1asf8JyV1tz1pqNISf15NX2n4Q7ivtjyKoXJh9j0NhkBnOqZu3Ia6ZXaijx8Ju5dmLPe45996Y4eJnpcGGENFDv9b27xoESaTxzg0WMJ3pHCF4r/1PilvNmiCvlBBw/kdpwOvftY2+v6TkUfLZUL4nsTAr7hdheqP9I6uvkhhn5k3jaZ3TwUdvHbwj3w0fROZdbedhD+nFW/hQ2RfC0ikmxQ24OH+er/j5UwKnNoSUlvi3/DkU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\\\0 & 0 & -1 & -5 & -5\\\\3 & -4 & -1 & 0 & 3\\\\0 & -5 & -4 & 0 & -4\\\\0 & 3 & -1 & 0 & 2\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡-5  0   1   -3  -4⎤\n",
       "⎢                  ⎥\n",
       "⎢0   0   -1  -5  -5⎥\n",
       "⎢                  ⎥\n",
       "⎢3   -4  -1  0   3 ⎥\n",
       "⎢                  ⎥\n",
       "⎢0   -5  -4  0   -4⎥\n",
       "⎢                  ⎥\n",
       "⎣0   3   -1  0   2 ⎦"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = sy.randMatrix(5, min=-5, max = 5, percent = 80); A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAU8AAAB9CAYAAAAiCOHgAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4Ae2d77HdRNLGbReft+BStd/xZmDjCBYywLsRwGawFBFQkAFsBAtkAI7A2BmYAN4q27c2Ab/PT54Wo9FIat2joyPp9FTpjDTT6ul+pqfnz5FG9+/du/dIxwsdtfDLu3fvntYyIi0QCAQCgSMjcP/+/VfS72FNR/nF+x9kGd/rHOI8/JFfxHkgEAgEAleEwHcVXT9X2hek587zB3nTszlLefFH4v8yF0ZpH+r65i7lLs0vlyvOA4FAIBCQX/qxREF+h6Se8yzplr5+lpylOVAcJ+Hx++jPX9GZx3+t1L/p+K7iYN38/uS83pl0YLj/r1QiunKNHr+ltDby6DuHX8t4hyfSk2Wkn3U8Fla3NRU8eNl9Hn5Gu8XYI/814CEdN9meMNZ3Oh7KWO+d6xB/lgQ4KIsYB/lhWZ7SWH/9wtKh0QF9R76UNsnP+KwZJ5kZybd4Ku0rHeje6ka+wqS+ogEDF7+8zL2cJ/1wmD/oAA+A6dnGTLxc/LaIEbrrcMkvOq/9uPhtGA+X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$\\displaystyle \\left[\\begin{matrix}-505 & 303 & -101 & -101 & -303\\\\-180 & 108 & -300 & -58 & 244\\\\-30 & 18 & -50 & -380 & -700\\\\-249 & -295 & -415 & 179 & -255\\\\255 & -153 & 425 & -103 & 395\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡-505  303   -101  -101  -303⎤\n",
       "⎢                            ⎥\n",
       "⎢-180  108   -300  -58   244 ⎥\n",
       "⎢                            ⎥\n",
       "⎢-30    18   -50   -380  -700⎥\n",
       "⎢                            ⎥\n",
       "⎢-249  -295  -415  179   -255⎥\n",
       "⎢                            ⎥\n",
       "⎣255   -153  425   -103  395 ⎦"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A_adjugate = sy.matrices.MatrixDeterminant.adjugate(A); A_adjugate "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's verify if this is really the adjugate of $A$, we pick element of $(1, 3), (2, 4), (5, 4)$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAACMAAAAOCAYAAACl66WxAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABo0lEQVQ4Ea2VgW3CQAxFkyoDBLoB3YCqG2QEWAE2qNQJKkagK9ANmk7Qhg1gA0o3SP872Si5UpHqsOT47sex/9mJk7dtm6VKnucTxVhanFKW/Uqxa8NORr4r2xxk76T47QMGmRRVEJKvuzG0X0g55SzCmy6mNc/upBP8koiEAFn2qGC9xJYErHEyWkNw53u3wqjUG/sbLVJlqwDfpiGWArOPZS4A31g+BFRqX5lMRolr6QjrWRR4Zuu1YySUfnX2vnTiVTIZj+hWREhK6Zci+ALOqbEXZFxccBh8WwmncobIg5R2fEpdxrbwKjiO9WqVVyOjKkAApRK0qZGdC38FGyC3hZXwXc5DSukxSRISO9C1EFBcqrCRHcn66btuvvaqHQo9yEP3fue/VsloDyMiJkebaFtl5HA7d2DH9kltsqoyyGgNXxQH+0v42pjMsXhl6msMvaOib0SkF0sYOIOv5J6EoXc848fnH4ZjL0DsOGRvSRZdX2G8wDCIcUb/6RehNS2C9JTncy6pohbxbjBhXWjHrx+ltfVJ9/hJIoyBZ3EI79sPyjSqpHPas+IAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$\\displaystyle -30$"
      ],
      "text/plain": [
       "-30"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAACMAAAAPCAYAAABut3YUAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABn0lEQVRIDb2VgW3CQAxFL50A0Q3oBrQjMAJdoSOAOkJHoCvQDcIKsAHdoIUN6HtHjEKEkgoiLFln+xz7392/S3E4HNKtUhTFmDqbeh1iA/wh8e96vM0uegKzo4nNA5C28kz9/dFMqQL4jv+DPqLmLclZMaYkmFuVMttK3WbtD3TQrEtscSG2JD41fjOQXOS4utZaNHxTL4Bxd9bGHzDuJU80em1rdk8wJUAm8KasuBO4PNKFTl8E9txtFsR1F+RHEBo3EzjzIzspzRnNK8n7yrHmGV7jWxA9ERZ7hErmSbMeMXfCOXWNjiKnlXSRdM1IEwFu69/iT1HBCNb5AJVB4+etFWFcz/+MPnKtC6GePLBZXjmjt+nsauMLzpzjO9VVtGueQq4wX816LrEAk4FHw3qONhJHOu3jNr1QMIhr8ZChBg031e2RU/uYjJGYvwsJPOwDzCcFvRVNmRDIz3wFYg8od+GSuJhV67lTpHOeIjZocmFGLPMgauALTm6ebp1ziFyaaff1zgjId0PxeH7ROQ3OjoWdGRP3R+l8yOlH+Qdg8HjBGdhVHwAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle -58$"
      ],
      "text/plain": [
       "-58"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAC0AAAAOCAYAAAC7IpUCAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB0klEQVRIDb2W7VECQQyGOYcCDu0AOwDtgBKgBejAGStwsANsATrwrICPDrADkQ7O91kTXI4dfgizmQnZZLPZd7O5DUVd161rUVEUPcWai/uKu0/Flc/U7F+S9+KpfD9jX/l0pU/MVkqi41cFG6AvYQUhKEBn4rWYLJSpmDY/9Dn8xFtxt2GbuY4UjcUMwtqLAMeBLfiTBT8BbRtvE2vI/LvbNfYYzcMBeo3fjQa5aKSNNonNlrINVBJkHcJnb4xOYtEPlBP0QLvuDjv/DRwQ8wCsxB2ku+hAQxtTgnkyHWXRcaTkbcqotRyGEproIG/4tPnJQA7Isxpv6dkvY6PA8hIB+FFMyazEgXKB9v3Oybt4UlkFKNyy8lhLjmRftDXghB/io5PifIZYHAKe8YmndrHSGPst8G4nCaDCyS3NJTttGVD6Se8rGdlDmxEtlRi3hQYjP8qCD7KZFMqDchnkLA9eAzpbkzzTlQBzABoUJcELQkJPKOeTR9d8OEHwe8sbABpIgC4SgH1tla0jCgR4adnNTvctW49586Flj103G+80AYK9MKP0/5OukixytWQDSX1Sk0vFf5UMZNf/LMU/Op6zF/kc1a/8qF06qBNldfjD9AOrk68cEx9iWgAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$\\displaystyle -103$"
      ],
      "text/plain": [
       "-103"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(-1)**(1+3) * sy.matrices.MatrixDeterminant.minor(A, 0, 2) # transpose the index\n",
    "(-1)**(2+4) * sy.matrices.MatrixDeterminant.minor(A, 3, 1)\n",
    "(-1)**(5+4) * sy.matrices.MatrixDeterminant.minor(A, 3, 4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Adjugate is the transpose of cofactor matrix, thus we reverse the row and column index above when referring to the elements in mind."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The ```sy.N()``` is for converting to float approximation, i.e. we don't want to see fractions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdQAAAB9CAYAAAAbQ5L+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4Ae2d7dHdRLLHbRefbxlTdb9jMjA4gsUZwCUCdjPYLUdAQQZrIgCcARCBsTOAALYKeGoT8P3/5Gkx0hlJPXo70vP0VM2RNNPdM/PvVs+LdEb3792790TxtWIpvHz79u3npYxICwQCgUAgEAgE7hIC9+/f/1XtfVxqs/rK++9lGd/oHOI8/JZfxHkgEAgEAoFAIHCHEfi60PZnSvuM9LxD/bd62DvRgWqUwQjjU8Xv1eYbgIgQCNx2BGT3T2Tvb/J2Ku2hrh/l976XLpcT5+MIeDH10o2XFrlbIaD75EVftnRG0kWH2qdb/VoFW+/+u4R/pPh1fiOPFSheOsF/JZpPdPyD64KD8NCxzP1vYgJDp51wI7nvk5LK/UfKxfkgn3r/lNKufliCq1VeMsDkB8WP1baLQUYtDlmdrIjv+rqyDDumOvxDdIa3ZZ32mOFQbfM0eg7/CI4/Kw8btk6Vc8LH7w7tr5euZTjayRzc8jbM4R/BHdFeTL10eXUPdT4Hu34DEpZX80cTuuxXt3ONI32r+FiO7N5WUfJ5TvuZydc5N3OzHm1pQ0fR0Yn9kOfrms6Zen9q6Tr30sFLfVBY07FmR+rU1FNH6sjMvcVF139XpNy2LXn+3ueqxxJcaZ9hgBza9bDfBtIUXTiIDh2AYa4Xyvi1L7d/nfg6eu7TnOla7ZmtG9o5l38Ix5SObhDOkfugpG/yJumOqgvV/VC4J126ME2430nssUXFQ/ijpAeXLxJt0yckPTcvJXGDbdahpgIvHKrSuaF/nLoxRQPIpRv/T6X/afwVdJ3OIeOnM2jzdP5PRbBpO0+do3TSXhvftY6qA4qcjWteb8mxtpZwtrxJHMBFscWQMhR+JObl9c+VTxk4Ep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IBAKBQCBwlxCIDvUuaTvaGggEAoFAILAZAtGhbgZtCA4EAoFAIBC4Swjkf5thQ/h+21/qzSX+wxMhEAgEAoFAIBC40wioj2RL2sdDINCh8leZzn6pGXH8jSYDI04DgUAgEAgE7jQC7eY1JRT+H4Iu1afSDjPaAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}-0.2273 & 0.1364 & -0.0455 & -0.0455 & -0.1364\\\\-0.081 & 0.0486 & -0.135 & -0.0261 & 0.1098\\\\-0.0135 & 0.0081 & -0.0225 & -0.171 & -0.315\\\\-0.1121 & -0.1328 & -0.1868 & 0.0806 & -0.1148\\\\0.1148 & -0.0689 & 0.1913 & -0.0464 & 0.1778\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡-0.2273  0.1364   -0.0455  -0.0455  -0.1364⎤\n",
       "⎢                                           ⎥\n",
       "⎢-0.081   0.0486   -0.135   -0.0261  0.1098 ⎥\n",
       "⎢                                           ⎥\n",
       "⎢-0.0135  0.0081   -0.0225  -0.171   -0.315 ⎥\n",
       "⎢                                           ⎥\n",
       "⎢-0.1121  -0.1328  -0.1868  0.0806   -0.1148⎥\n",
       "⎢                                           ⎥\n",
       "⎣0.1148   -0.0689  0.1913   -0.0464  0.1778 ⎦"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A_det = A.det()\n",
    "A_inv = (1/A_det)*A_adjugate; round_expr(sy.N(A_inv), 4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdQAAAB9CAYAAAAbQ5L+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4Ae2d7dHdRLLHbRefbxlTdb9jMjA4gsUZwCUCdjPYLUdAQQZrIgCcARCBsTOAALYKeGoT8P3/5Gkx0hlJPXo70vP0VM2RNNPdM/PvVs+LdE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CgGWHHf4ywDOjJiiN5Uo2tMDg+4EO4EJOn+jg10v14uVH96X/hKH/m6QTnLgbb9Ey4vxWsV12R1e6ZmA0a9YuvjWDF5tFZa6Jg/QA/tyL3Af9e5JOghA2P+3L3D7mHaSNb5y8P0rYS18XfivJvMZhF5vPGmY2ObbcDPkgndk8vkPnm/v5B1nlZ5+qoryM8ke6+Rs5OqdD+j/F5qUKEklTfKvYjJJJ2zFQH2Ie6Fx5btRJ1zXP+vjrTEkBOf+hz5fqxcsvusbBCLd2UJUw7ehfYNXgTefZv5FY7uWljdER6x5K8WIDDopLbH5tHJg1dZy76sfghXsAbG/2wG+rMpbqxcs/UH8w7PgS6CTTe3+UxBZllgi3TvNis4LNW1MMyxtLGDhO0dX4nYEifMlrzVApjVnDc4GJAyA8VfyblNA6P50zQqaTunhFX+mMfgDGRhu8dQjvK/HZ31rolF104muC6HHCJrPZxEHXdJa84ciLMnT4vImaO+/O/ycbQef9WaQXNXuSH2iEJS908QKRPeNkubyvfzfe6EeyPpAMbIoisI2jbeA+iY3ascjma3AQTpP3huS9EB33gekJbLln2dXq7LNT2kJYpBcPf1NK+klYFn2M0QnbyfvDaDl6ZOb0O54vwlbtmrTRrC34fzrTV1la6XSUDrtWubv4eTwVS2jMGD9SwaeekZWQjrRAIBAIBAKBQGArBNRZN/8qUf95/8FWhYTcQCAQCAQCgUDgLiEQHepd0na0NRAIBAKBQGAzBKJD3QzaEBwIBAKBQCBwlxCIDvUuaTvaGggEAoFAILAZAtGhbgZtCA4EAoFAIBC4Swjkf5thQ/h+21/qzSX+wxMhEAgEAoFAIBC40wioj2RL2sdDINCh8leZzn6pGXH8jSYDI04DgUAgEAgE7jQC7eY1JRT+H4Iu1afSDjPaAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}-0.2273 & 0.1364 & -0.0455 & -0.0455 & -0.1364\\\\-0.081 & 0.0486 & -0.135 & -0.0261 & 0.1098\\\\-0.0135 & 0.0081 & -0.0225 & -0.171 & -0.315\\\\-0.1121 & -0.1328 & -0.1868 & 0.0806 & -0.1148\\\\0.1148 & -0.0689 & 0.1913 & -0.0464 & 0.1778\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡-0.2273  0.1364   -0.0455  -0.0455  -0.1364⎤\n",
       "⎢                                           ⎥\n",
       "⎢-0.081   0.0486   -0.135   -0.0261  0.1098 ⎥\n",
       "⎢                                           ⎥\n",
       "⎢-0.0135  0.0081   -0.0225  -0.171   -0.315 ⎥\n",
       "⎢                                           ⎥\n",
       "⎢-0.1121  -0.1328  -0.1868  0.0806   -0.1148⎥\n",
       "⎢                                           ⎥\n",
       "⎣0.1148   -0.0689  0.1913   -0.0464  0.1778 ⎦"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "round_expr(sy.N(A.inv()), 4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We have shown that are the same."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAJcAAAB9CAYAAACvQPGdAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAH2UlEQVR4Ae2d7Y3cNhCGtYF/G0YMpIC7DjZxBXY6cFpIakgJTgdOC7kS0kGQ68ApIEASww1cZnY1K3FFiSMtuXc8PgLWIqmPWT58RelEvt5d13V7+fwpn9hy9/Dw8ENsA2UQ2O12n4TCTYyE6Gb3YrThF0nrzuPlr3GGNATOCHw4y2v2e/m818RYXB9FbYhJqbC4CIhefj3fUXozLZqI63y/SV4ONKX+Ixtv5fPhWoIkdlclc33mepDPjQilm/vIdn0ue2/bJf1KPod7rpWVWhP72C41MJfv+KN8RAoP3VeSSC7Sa+gBr+SAO9tZ0p8lrfmPVlZiTex6mbvEJaLRvxjvI+L5Q8reiQC0Fyu1EDskWw1zr7jeSf3+Det4yGnvpYtuL7UQOyRbDfOk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OVGUgPeBPnowhRBYIoC4luiw7SICiOsifBy8RABxLdFh20UExnPoP8mT/vnJ7mQ4QCfrsUBgQkD0cpjuPdnQF6i47JdiY/usmowfOwFlz5qAGVeilfwfne4Z3THqsR0AAAAASUVORK5CYII=\n",
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "⎡0  0  0  0  0⎤\n",
       "⎢             ⎥\n",
       "⎢0  0  0  0  0⎥\n",
       "⎢             ⎥\n",
       "⎢0  0  0  0  0⎥\n",
       "⎢             ⎥\n",
       "⎢0  0  0  0  0⎥\n",
       "⎢             ⎥\n",
       "⎣0  0  0  0  0⎦"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A_inv-A.inv()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <font face=\"gotham\" color=\"purple\"> The Short Proof"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We define $x$ the $j$th column of $A^{-1}$ which satifies\n",
    "$$\n",
    "Ax= e_j\n",
    "$$\n",
    "\n",
    "and $e_j$ is the $j$th column of identity matrix, and $j$th entry of $x$ is the $(i,j)$-entry of $A^{-1}$.By Cramer's rule,\n",
    "\n",
    "$$\\left\\{(i, j) \\text { -entry of } A^{-1}\\right\\}=x_{i}=\\frac{\\operatorname{det} A_{i}\\left(\\mathbf{e}_{j}\\right)}{\\operatorname{det} A}$$\n",
    "\n",
    "The cofactor expansion down column $i$ of $A_i(e_j)$,\n",
    "$$\\operatorname{det} A_{i}\\left(\\mathbf{e}_{j}\\right)=(-1)^{i+j} \\operatorname{det} A_{j i}=C_{j i}$$"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
